package fr.vincent7894.feedroid.utils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

public class XmlPullParserFactoryUtils {

	private static XmlPullParserFactory XML_PULL_PARSER_FACTORY = null;

	static {
		try {
			XML_PULL_PARSER_FACTORY = XmlPullParserFactory.newInstance();
			XML_PULL_PARSER_FACTORY.setFeature(
					XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
			XML_PULL_PARSER_FACTORY.setFeature(
					XmlPullParser.FEATURE_VALIDATION, false);
			XML_PULL_PARSER_FACTORY.setFeature(
					XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES, false);
		} catch (XmlPullParserException e) {
			e.printStackTrace();
		}
	}

	public static XmlPullParser newParser() throws Exception {
		return XML_PULL_PARSER_FACTORY.newPullParser();
	}
}
